1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.purple.dnsquery; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import derelict.glib.gslist; 34 import derelict.purple.account; 35 36 extern (C): 37 38 alias _PurpleDnsQueryData PurpleDnsQueryData; 39 alias void function (_GSList*, void*, const(char)*) PurpleDnsQueryConnectFunction; 40 alias void function (_PurpleDnsQueryData*, _GSList*) PurpleDnsQueryResolvedCallback; 41 alias void function (_PurpleDnsQueryData*, const(char)*) PurpleDnsQueryFailedCallback; 42 alias _Anonymous_0 PurpleDnsQueryUiOps; 43 44 struct _Anonymous_0 45 { 46 gboolean function (PurpleDnsQueryData*, PurpleDnsQueryResolvedCallback, PurpleDnsQueryFailedCallback) resolve_host; 47 void function (PurpleDnsQueryData*) destroy; 48 void function () _purple_reserved1; 49 void function () _purple_reserved2; 50 void function () _purple_reserved3; 51 void function () _purple_reserved4; 52 } 53 54 struct _PurpleDnsQueryData; 55 56 version(Derelict_Link_Static) 57 { 58 extern( C ) nothrow 59 { 60 PurpleDnsQueryData* purple_dnsquery_a_account(PurpleAccount* account, const(char)* hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data); 61 PurpleDnsQueryData* purple_dnsquery_a(const(char)* hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data); 62 void purple_dnsquery_destroy(PurpleDnsQueryData* query_data); 63 void purple_dnsquery_set_ui_ops(PurpleDnsQueryUiOps* ops); 64 PurpleDnsQueryUiOps* purple_dnsquery_get_ui_ops(); 65 char* purple_dnsquery_get_host(PurpleDnsQueryData* query_data); 66 ushort purple_dnsquery_get_port(PurpleDnsQueryData* query_data); 67 void purple_dnsquery_init(); 68 void purple_dnsquery_uninit(); 69 } 70 } 71 else 72 { 73 extern( C ) nothrow 74 { 75 alias da_purple_dnsquery_a_account = PurpleDnsQueryData* function(PurpleAccount* account, const(char)* hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data); 76 alias da_purple_dnsquery_a = PurpleDnsQueryData* function(const(char)* hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data); 77 alias da_purple_dnsquery_destroy = void function(PurpleDnsQueryData* query_data); 78 alias da_purple_dnsquery_set_ui_ops = void function(PurpleDnsQueryUiOps* ops); 79 alias da_purple_dnsquery_get_ui_ops = PurpleDnsQueryUiOps* function(); 80 alias da_purple_dnsquery_get_host = char* function(PurpleDnsQueryData* query_data); 81 alias da_purple_dnsquery_get_port = ushort function(PurpleDnsQueryData* query_data); 82 alias da_purple_dnsquery_init = void function(); 83 alias da_purple_dnsquery_uninit = void function(); 84 } 85 86 __gshared 87 { 88 da_purple_dnsquery_a_account purple_dnsquery_a_account; 89 da_purple_dnsquery_a purple_dnsquery_a; 90 da_purple_dnsquery_destroy purple_dnsquery_destroy; 91 da_purple_dnsquery_set_ui_ops purple_dnsquery_set_ui_ops; 92 da_purple_dnsquery_get_ui_ops purple_dnsquery_get_ui_ops; 93 da_purple_dnsquery_get_host purple_dnsquery_get_host; 94 da_purple_dnsquery_get_port purple_dnsquery_get_port; 95 da_purple_dnsquery_init purple_dnsquery_init; 96 da_purple_dnsquery_uninit purple_dnsquery_uninit; 97 } 98 }